-- background: 4661 from stack: in.0-3 -- bmap block id: 5200 -- flags: 0000 -- background id: 0 -- name: text ----- HyperTalk script ----- on openBackground global MapMode put "text" into MapMode end openBackground -- part 3 (button) -- low flags: 00 -- high flags: 2000 -- rect: left=474 top=235 right=264 bottom=506 -- title width / last selected line: 0 -- icon id / first selected line: 10112 / 10112 -- text alignment: 1 -- font id: 0 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: HomeBtn ----- HyperTalk script ----- -- This handler lets the user quit or go home. -- It goes to cd "hi" of the Intro stack first to reset things. on mouseUp answer "What do you want to do?" with "Cancel" or "Quit" or "Go Home" if it is not "Cancel" then lock screen global CameFrom,stakName put the short name of this cd into CameFrom put the short name of this stack into stakName go to cd "hi" of stack "Intro to HyperCard 2.0" if it is "Quit" then put "doMenu " & quote & "Quit HyperCard" & quote into myMsg send myMsg to this cd else if it is "Go Home" then send "doMenu Home" to this cd end if end mouseUp -- part 8 (field) -- low flags: 01 -- high flags: 2007 -- rect: left=10 top=72 right=329 bottom=459 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 0 -- font id: 174 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: index ----- HyperTalk script ----- -- This handler goes to the cd the user chose. on mouseUp global MapMode -- compute line number clicked get item 2 of the clickLoc - top of me + scroll of me put 1 + it div the textHeight of me into lineNum -- Highlight the text in the line select line lineNum of me put stripLeadBlanks (line lineNum of me) into Subject delete word 1 of Subject lock screen put line lineNum of cd fld "ButtonDests" into myBtnInfo -- put "send mouseUp to " & (item 1 of myBtnInfo) & " of cd " & -- (item 2 of myBtnInfo) into myAction -- put myAction -- do myAction -- send mouseUp to (item 1 of myBtnInfo) of cd (item 2 of myBtnInfo) put "go cd " & item 2 of myBtnInfo into myAction do myAction send mouseUp to (item 1 of myBtnInfo) unlock screen with visual dissolve put "text" into MapMode end mouseUp -- This handler goes to the cd the user chose. on mouseUp global MapMode -- compute line number clicked get item 2 of the clickLoc - top of me + scroll of me put 1 + it div the textHeight of me into lineNum -- Highlight the text in the line select line lineNum of me put stripLeadBlanks (line lineNum of me) into Subject delete word 1 of Subject if subject is in cd fld "level 1" then send mouseUp to bg btn Subject of cd "level 1" else if subject is in cd fld "sublevel 1" then go cd "level 1" if subject is line 1 of cd fld "sublevel 1" then send mouseUp to bg btn "section 1:" else if subject is line 2 of cd fld "sublevel 1" then send mouseUp to bg btn "section 2:" else if subject is line 3 of cd fld "sublevel 1" then send mouseUp to bg btn "section 3:" end if else if subject is in cd fld "SAs" then if subject is line 1 of cd fld "SAs" then send mouseUp to cd btn "section 1:" of cd "section 1:" else if subject is line 2 of cd fld "SAs" then send mouseUp to cd btn "section 2:1" of cd "section 2:" else if subject is line 3 of cd fld "SAs" then send mouseUp to cd btn "section 2:2" of cd "section 2:" else if subject is line 4 of cd fld "SAs" then send mouseUp to cd btn "section 3:" of cd "section 3:" end if else if subject is in cd fld "section 1:" then put IDoffBtn (Subject, "section 1:") into IDnum send mouseUp to btn id IDnum of cd "section 1:" else if subject is in cd fld "section 2:" then put IDoffBtn (Subject, "section 2:") into IDnum send mouseUp to btn id IDnum of cd "section 2:" else if subject is in cd fld "section 3:" then put IDoffBtn (Subject, "section 3:") into IDnum send mouseUp to btn id IDnum of cd "section 3:" end if unlock screen with visual dissolve put "text" into MapMode end mouseUp -- This function returns the ID of the clicked btn. function IDoffBtn Subject, Section lock screen go cd Section repeat with i=1 to number of btns if (char 1 to 15 of the short name of btn i) is (char 1 to 15 of subject) then return the ID of btn i end if end repeat end IDoffBtn